/*
 * All right reserved@Raygo 2022~2030
 */

package com.raygo.runner.core.result;

/**
 * 带缓存的值
 *
 * @author Raygo
 * @since 2022年8月8日
 */
public class CacheResult<T> {
    /**
     * 缓存时间
     */
    private long cacheTime;
    /**
     * 值
     */
    private T value;

    /**
     * 构造
     *
     * @param value 值
     */
    public CacheResult(T value) {
        setValue(value);
    }

    /**
     * Get value value
     *
     * @return the value
     */
    public T getValue() {
        return value;
    }

    /**
     * Set value to value
     *
     * @param value the value to set
     */
    public void setValue(T value) {
        this.value = value;
        cacheTime = System.currentTimeMillis();
    }

    /**
     * Get cacheTime value
     *
     * @return the cacheTime
     */
    public long getCacheTime() {
        return cacheTime;
    }
}
